/*
 * @Description:
 * @Autor: zzj
 * @Date: 2023-08-29 16:06:51
 * @LastEditors: zzj liberty666@aliyun.com
 * @LastEditTime: 2023-09-11 15:30:13
 * @FilePath: \vite-project\src\router\routes.ts
 */
// 对外暴露配置路由(常量)
export const constantRoute = [
  {
    path: '/login',
    component: () => import('@/views/login/index.vue'),
    name: 'login', //命名路由
    meta: {
      title: '登录', //菜单标题
      hidden: true,
    },
  },
  {
    // 登录成功以后展示的路由
    path: '/',
    component: () => import('@/layout/index.vue'),
    name: 'layout',
    meta: {
      title: '首页',
      hidden: false,
    },
    children: [
      {
        path: '/home',
        component: () => import('@/views/home/index.vue'),
        meta: {
          title: '首页',
          hidden: false,
        },
      },
      {
        path: '/ceshi',
        component: () => import('@/views/home/index.vue'),
        meta: {
          title: '测试',
          hidden: false,
        },
      },
    ],
  },
  {
    path: '/404',
    component: () => import('@/views/404/index.vue'),
    name: '404',
    meta: {
      title: '404',
      hidden: true,
    },
  },
  {
    // 任意路由，如果任何一个页面都没匹配上，就重定向到404页面
    path: '/:pathMatch(.*)*',
    redirect: '/404',
    name: 'any',
    meta: {
      title: 'Any',
      hidden: true,
    },
  },
]
